package com.jumi.microservice.dto.afterseal;

import com.jumi.microservice.common.exception.BaseException;
import com.jumi.microservice.common.page.PageDomain;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author wangjingdao
 */
public class AfterSealNoSelfRequest extends PageDomain {
    @ApiModelProperty("供货商/发货仓")
    private Integer type;
    @ApiModelProperty("供货商id")
    private Integer warehouse;
    @ApiModelProperty("商品昵称")
    private String goodsName;
    @ApiModelProperty("下单时间")
    private String startTime;
    @ApiModelProperty("下单结束时间")
    private String endTime;
    @ApiModelProperty("订单ID列表，英文逗号分隔")
    private String ids;

    public String getIds() {
        return ids;
    }

    public void setIds(String ids) {
        this.ids = ids;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getWarehouse() {
        return warehouse;
    }

    public void setWarehouse(Integer warehouse) {
        this.warehouse = warehouse;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    @Override
    public void checkRequest() {
        if (
                this.type == null && this.warehouse == null && this.goodsName == null && this.startTime == null && this.endTime == null && this.ids == null
        ) {
            throw new BaseException(500, "请先选择搜索条件");
        }
    }
}
